/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Configuration.java
 *
 * Created on 19.06.2010, 18:25:42
 */

package omg;

import omg.UserInterfaces.UserInt;

/**
 *
 * @author loli
 */
public class Configuration extends javax.swing.JFrame {

    /** Creates new form Configuration */
    public Configuration() {
        initComponents();
        UserInt.getInstance().registerConfiguration(this);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jFileChooser1 = new javax.swing.JFileChooser();
        jFileChooser2 = new javax.swing.JFileChooser();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        stringRepresentation = new javax.swing.JTextField();
        youdlLocation = new javax.swing.JTextField();
        youdlLocationButton = new javax.swing.JButton();
        ffmpegLocationButton = new javax.swing.JButton();
        ffmpegLocation = new javax.swing.JTextField();
        buttonSave = new javax.swing.JButton();
        buttonCancel = new javax.swing.JButton();
        notices = new javax.swing.JLabel();

        jFileChooser1.setName("jFileChooser1"); // NOI18N
        jFileChooser1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jFileChooser1ActionPerformed(evt);
            }
        });

        jFileChooser2.setName("jFileChooser2"); // NOI18N
        jFileChooser2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jFileChooser2ActionPerformed(evt);
            }
        });

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(omg.OMGApp.class).getContext().getResourceMap(Configuration.class);
        setTitle(resourceMap.getString("Form.title")); // NOI18N
        setName("Form"); // NOI18N

        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N

        jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
        jLabel2.setName("jLabel2"); // NOI18N

        jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
        jLabel3.setName("jLabel3"); // NOI18N

        stringRepresentation.setText(resourceMap.getString("stringRepresentation.text")); // NOI18N
        stringRepresentation.setName("stringRepresentation"); // NOI18N

        youdlLocation.setText(resourceMap.getString("youdlLocation.text")); // NOI18N
        youdlLocation.setName("youdlLocation"); // NOI18N

        youdlLocationButton.setText(resourceMap.getString("youdlLocationButton.text")); // NOI18N
        youdlLocationButton.setName("youdlLocationButton"); // NOI18N
        youdlLocationButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                youdlLocationButtonActionPerformed(evt);
            }
        });

        javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(omg.OMGApp.class).getContext().getActionMap(Configuration.class, this);
        ffmpegLocationButton.setAction(actionMap.get("ss")); // NOI18N
        ffmpegLocationButton.setText(resourceMap.getString("ffmpegLocationButton.text")); // NOI18N
        ffmpegLocationButton.setName("ffmpegLocationButton"); // NOI18N
        ffmpegLocationButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ffmpegLocationButtonActionPerformed(evt);
            }
        });

        ffmpegLocation.setText(resourceMap.getString("ffmpegLocation.text")); // NOI18N
        ffmpegLocation.setName("ffmpegLocation"); // NOI18N

        buttonSave.setText(resourceMap.getString("buttonSave.text")); // NOI18N
        buttonSave.setName("buttonSave"); // NOI18N

        buttonCancel.setText(resourceMap.getString("buttonCancel.text")); // NOI18N
        buttonCancel.setName("buttonCancel"); // NOI18N
        buttonCancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonCancelActionPerformed(evt);
            }
        });

        notices.setFont(resourceMap.getFont("notices.font")); // NOI18N
        notices.setText(resourceMap.getString("notices.text")); // NOI18N
        notices.setName("notices"); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel1)
                            .addComponent(jLabel2)
                            .addComponent(jLabel3))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(ffmpegLocation, javax.swing.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE)
                                    .addComponent(youdlLocation, javax.swing.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(youdlLocationButton, javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(ffmpegLocationButton, javax.swing.GroupLayout.Alignment.TRAILING)))
                            .addComponent(stringRepresentation, javax.swing.GroupLayout.DEFAULT_SIZE, 225, Short.MAX_VALUE)))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(notices, javax.swing.GroupLayout.DEFAULT_SIZE, 259, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(buttonCancel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(buttonSave)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(stringRepresentation, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(youdlLocation, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(youdlLocationButton))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(ffmpegLocationButton)
                    .addComponent(ffmpegLocation, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(buttonSave)
                    .addComponent(buttonCancel)
                    .addComponent(notices, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void youdlLocationButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_youdlLocationButtonActionPerformed
        this.jFileChooser1.showOpenDialog(this);
    }//GEN-LAST:event_youdlLocationButtonActionPerformed

    private void ffmpegLocationButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ffmpegLocationButtonActionPerformed
        this.jFileChooser2.showOpenDialog(this);
    }//GEN-LAST:event_ffmpegLocationButtonActionPerformed

    private void buttonCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonCancelActionPerformed
        this.dispose();
    }//GEN-LAST:event_buttonCancelActionPerformed

    private void jFileChooser1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jFileChooser1ActionPerformed
        if (!evt.getActionCommand().equalsIgnoreCase("CancelSelection"))
            this.youdlLocation.setText(this.jFileChooser1.getSelectedFile().toString());
    }//GEN-LAST:event_jFileChooser1ActionPerformed

    private void jFileChooser2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jFileChooser2ActionPerformed
        if (!evt.getActionCommand().equalsIgnoreCase("CancelSelection"))
            this.ffmpegLocation.setText(this.jFileChooser2.getSelectedFile().toString());
    }//GEN-LAST:event_jFileChooser2ActionPerformed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Configuration().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    public javax.swing.JButton buttonCancel;
    public javax.swing.JButton buttonSave;
    public javax.swing.JTextField ffmpegLocation;
    private javax.swing.JButton ffmpegLocationButton;
    private javax.swing.JFileChooser jFileChooser1;
    private javax.swing.JFileChooser jFileChooser2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    public javax.swing.JLabel notices;
    public javax.swing.JTextField stringRepresentation;
    public javax.swing.JTextField youdlLocation;
    private javax.swing.JButton youdlLocationButton;
    // End of variables declaration//GEN-END:variables

}
